package eerbaar.v2.effects.internal;

import java.awt.Graphics2D;

import eerbaar.game.IGame;
import eerbaar.persona.IPersona;
import eerbaar.position.IPosition;
import eerbaar.v2.app.GameHelper;
import eerbaar.v2.app.view.Standard;
import eerbaar.v2.effects.Effect;

public class Ring implements Effect {

    private boolean expired;

    @Override
    public void display(int time, Graphics2D canvas) {

        IGame game = GameHelper.getGame();
        if (game == null) {
            return;
        }

        IPersona pet = game.getPersona("pet");
        IPosition p = pet.getPosition();

        final int x = p.getX() + 27;
        final int y = p.getY() + 27;
        final int width = 14;

        // canvas.set.setLineWidth(8);
        canvas.setColor(Standard.YELLOW);
        canvas.drawArc(x, y, width, 0, 0, 360);

    }

    public boolean isExpired() {
        return this.expired;
    }

    @Override
    public boolean isExpired(int time) {

        return this.expired;
    }

    @Override
    public void setExpired(boolean expired) {

        this.expired = expired;
    }

}
